package ua.com.globallogic.training.immutability;

public class ImmutablePizza {
    private final int diameter;
    private final Stuffing[] stuffings;
    private final Weight weight;

    public ImmutablePizza(int diameter, Stuffing[] stuffings, Weight weight) {
        this.diameter = diameter;
        this.stuffings = new Stuffing[stuffings.length];
        for (int i = 0; i < stuffings.length; i++) {
            this.stuffings[i] = new Stuffing(stuffings[i].getStuffing());
        }
        this.weight = new Weight(weight);
    }

    public Stuffing[] getStuffings() {
        return stuffings;
    }

    public int getDiameter() {
        return diameter;
    }

    public Double getWeight() {
        return weight.getWeight();
    }
}
